﻿//-----------------------------------------------------------------------
// <copyright file="SA1633.cs" company="c0x3y">
//     Copyright (c) c0x3y. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace c0x3y.StyleCopFixer.Errors
{
    using EnvDTE80;

    public class SA1633
    {
        public static void Run(EnvDTE.DTE dte, ErrorItem selectedError)
        {
                selectedError.Navigate();
                EditPoint2 editPoint = ErrorUtilities.GetEditPoint(dte);
                editPoint.StartOfDocument();
                string fileName = selectedError.FileName.Substring(selectedError.FileName.LastIndexOf(@"\") + 1, selectedError.FileName.Length - (selectedError.FileName.LastIndexOf(@"\") + 1));
                editPoint.InsertNewLine();
                editPoint.StartOfDocument();
                editPoint.Insert(string.Format(
@"//-----------------------------------------------------------------------
// <copyright file=""{0}"" company=""{1}"">
//     Copyright (c) {1}. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------", fileName, Properties.StyleCopFixer.Default.CompanyName));              
            }            
    }
}
